//auto gen by paipai.java.augogen ver 3.0.0
//author skyzhuang
//source idl: com.erp.storage.dao.idl.GetStockBranch_RelBySysNoResp.java


#ifndef ERP_STORAGE_DDO_CSTOCKBRANCH_RELDDO_BY_AUTOGEN_V5_H
#define ERP_STORAGE_DDO_CSTOCKBRANCH_RELDDO_BY_AUTOGEN_V5_H


#include "app_platform/intf_serializable.h"
#include <string>
#include <sstream>
#include <iostream>


namespace erp
{
namespace storage
{
namespace ddo
{


class CStockBranch_RelDdo : public ISerializable
{
	public:
		std::string m_sLastErrMsg;///<错误信息

		/**
		 *  版本号   
		 *
		 * 版本 >= 0
		 */
		uint32_t dwVersion;

		/**
		 * cVersion_u uflag field
		 */
		uint8_t cVersion_u; //optional flag

		/**
		 *  仓库SysNo 
		 *
		 * 版本 >= 0
		 */
		uint64_t ddwFStockSysNo;

		/**
		 * cFStockSysNo_u uflag field
		 */
		uint8_t cFStockSysNo_u; //optional flag

		/**
		 *  分支机构SysNo 
		 *
		 * 版本 >= 0
		 */
		uint64_t ddwFBranchSysNo;

		/**
		 * cFBranchSysNo_u uflag field
		 */
		uint8_t cFBranchSysNo_u; //optional flag

		/**
		 *  联系人SysNo
		 *
		 * 版本 >= 0
		 */
		uint64_t ddwFContactSysNos;

		/**
		 * cFContactSysNos_u uflag field
		 */
		uint8_t cFContactSysNos_u; //optional flag

		/**
		 *  创建人SysNo
		 *
		 * 版本 >= 0
		 */
		uint64_t ddwFCreatorSysNo;

		/**
		 * cFCreatorSysNo_u uflag field
		 */
		uint8_t cFCreatorSysNo_u; //optional flag

		/**
		 *  创建时间
		 *
		 * 版本 >= 0
		 */
		uint32_t dwFRowCreatDate;

		/**
		 * cFRowCreatDate_u uflag field
		 */
		uint8_t cFRowCreatDate_u; //optional flag

		/**
		 *  修改人SysNo
		 *
		 * 版本 >= 0
		 */
		uint64_t ddwFModifierSysNo;

		/**
		 * cFModifierSysNo_u uflag field
		 */
		uint8_t cFModifierSysNo_u; //optional flag

		/**
		 *  修改时间
		 *
		 * 版本 >= 0
		 */
		uint32_t dwFRowModifyDate;

		/**
		 * cFRowModifyDate_u uflag field
		 */
		uint8_t cFRowModifyDate_u; //optional flag




	public:
		CStockBranch_RelDdo():
		dwVersion(0),
		cVersion_u(0),
		ddwFStockSysNo(0),
		cFStockSysNo_u(0),
		ddwFBranchSysNo(0),
		cFBranchSysNo_u(0),
		ddwFContactSysNos(0),
		cFContactSysNos_u(0),
		ddwFCreatorSysNo(0),
		cFCreatorSysNo_u(0),
		dwFRowCreatDate(0),
		cFRowCreatDate_u(0),
		ddwFModifierSysNo(0),
		cFModifierSysNo_u(0),
		dwFRowModifyDate(0),
		cFRowModifyDate_u(0) {}
				CStockBranch_RelDdo& operator = (const CStockBranch_RelDdo& obj){

			this->dwVersion = obj.dwVersion;
			this->ddwFStockSysNo = obj.ddwFStockSysNo;
			this->ddwFBranchSysNo = obj.ddwFBranchSysNo;
			this->ddwFContactSysNos = obj.ddwFContactSysNos;
			this->ddwFCreatorSysNo = obj.ddwFCreatorSysNo;
			this->dwFRowCreatDate = obj.dwFRowCreatDate;
			this->ddwFModifierSysNo = obj.ddwFModifierSysNo;
			this->dwFRowModifyDate = obj.dwFRowModifyDate;
			this->cVersion_u = obj.cVersion_u;
			this->cFStockSysNo_u = obj.cFStockSysNo_u;
			this->cFBranchSysNo_u = obj.cFBranchSysNo_u;
			this->cFContactSysNos_u = obj.cFContactSysNos_u;
			this->cFCreatorSysNo_u = obj.cFCreatorSysNo_u;
			this->cFRowCreatDate_u = obj.cFRowCreatDate_u;
			this->cFModifierSysNo_u = obj.cFModifierSysNo_u;
			this->cFRowModifyDate_u = obj.cFRowModifyDate_u;
			return *this;
		}

	public:


		/**
		 * 是否设置 版本号   了
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 bool  IsVersionSet() const{
				 return  cVersion_u != 0;
		}


		/**
		 * 获取uflag 版本号   了
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 const uint8_t   GetVersionUFlag() const{
				 return  cVersion_u;
		}


		/**
		 * 设置 版本号   
		 * 
		 * @param uint32_t:dwVersion
		 *  
		 * 
		 */
		 void  SetVersion( const uint32_t& sVal, uint8_t cUFlag=1){
				dwVersion = sVal;
				cVersion_u = cUFlag;
		}


		/**
		 * 获取 版本号   
		 * 
		 * @return dwVersion value 类型为:uint32_t
		 * 
		 */
		 const uint32_t&  GetVersion() const {
				return dwVersion;
		}


		/**
		 * 是否设置 仓库SysNo 了
		 * 
		 * @param uint64_t:ddwFStockSysNo
		 *  
		 * 
		 */
		 bool  IsFStockSysNoSet() const{
				 return  cFStockSysNo_u != 0;
		}


		/**
		 * 获取uflag 仓库SysNo 了
		 * 
		 * @param uint64_t:ddwFStockSysNo
		 *  
		 * 
		 */
		 const uint8_t   GetFStockSysNoUFlag() const{
				 return  cFStockSysNo_u;
		}


		/**
		 * 设置 仓库SysNo 
		 * 
		 * @param uint64_t:ddwFStockSysNo
		 *  
		 * 
		 */
		 void  SetFStockSysNo( const uint64_t& sVal, uint8_t cUFlag=1){
				ddwFStockSysNo = sVal;
				cFStockSysNo_u = cUFlag;
		}


		/**
		 * 获取 仓库SysNo 
		 * 
		 * @return ddwFStockSysNo value 类型为:uint64_t
		 * 
		 */
		 const uint64_t&  GetFStockSysNo() const {
				return ddwFStockSysNo;
		}


		/**
		 * 是否设置 分支机构SysNo 了
		 * 
		 * @param uint64_t:ddwFBranchSysNo
		 *  
		 * 
		 */
		 bool  IsFBranchSysNoSet() const{
				 return  cFBranchSysNo_u != 0;
		}


		/**
		 * 获取uflag 分支机构SysNo 了
		 * 
		 * @param uint64_t:ddwFBranchSysNo
		 *  
		 * 
		 */
		 const uint8_t   GetFBranchSysNoUFlag() const{
				 return  cFBranchSysNo_u;
		}


		/**
		 * 设置 分支机构SysNo 
		 * 
		 * @param uint64_t:ddwFBranchSysNo
		 *  
		 * 
		 */
		 void  SetFBranchSysNo( const uint64_t& sVal, uint8_t cUFlag=1){
				ddwFBranchSysNo = sVal;
				cFBranchSysNo_u = cUFlag;
		}


		/**
		 * 获取 分支机构SysNo 
		 * 
		 * @return ddwFBranchSysNo value 类型为:uint64_t
		 * 
		 */
		 const uint64_t&  GetFBranchSysNo() const {
				return ddwFBranchSysNo;
		}


		/**
		 * 是否设置 联系人SysNo了
		 * 
		 * @param uint64_t:ddwFContactSysNos
		 *  
		 * 
		 */
		 bool  IsFContactSysNosSet() const{
				 return  cFContactSysNos_u != 0;
		}


		/**
		 * 获取uflag 联系人SysNo了
		 * 
		 * @param uint64_t:ddwFContactSysNos
		 *  
		 * 
		 */
		 const uint8_t   GetFContactSysNosUFlag() const{
				 return  cFContactSysNos_u;
		}


		/**
		 * 设置 联系人SysNo
		 * 
		 * @param uint64_t:ddwFContactSysNos
		 *  
		 * 
		 */
		 void  SetFContactSysNos( const uint64_t& sVal, uint8_t cUFlag=1){
				ddwFContactSysNos = sVal;
				cFContactSysNos_u = cUFlag;
		}


		/**
		 * 获取 联系人SysNo
		 * 
		 * @return ddwFContactSysNos value 类型为:uint64_t
		 * 
		 */
		 const uint64_t&  GetFContactSysNos() const {
				return ddwFContactSysNos;
		}


		/**
		 * 是否设置 创建人SysNo了
		 * 
		 * @param uint64_t:ddwFCreatorSysNo
		 *  
		 * 
		 */
		 bool  IsFCreatorSysNoSet() const{
				 return  cFCreatorSysNo_u != 0;
		}


		/**
		 * 获取uflag 创建人SysNo了
		 * 
		 * @param uint64_t:ddwFCreatorSysNo
		 *  
		 * 
		 */
		 const uint8_t   GetFCreatorSysNoUFlag() const{
				 return  cFCreatorSysNo_u;
		}


		/**
		 * 设置 创建人SysNo
		 * 
		 * @param uint64_t:ddwFCreatorSysNo
		 *  
		 * 
		 */
		 void  SetFCreatorSysNo( const uint64_t& sVal, uint8_t cUFlag=1){
				ddwFCreatorSysNo = sVal;
				cFCreatorSysNo_u = cUFlag;
		}


		/**
		 * 获取 创建人SysNo
		 * 
		 * @return ddwFCreatorSysNo value 类型为:uint64_t
		 * 
		 */
		 const uint64_t&  GetFCreatorSysNo() const {
				return ddwFCreatorSysNo;
		}


		/**
		 * 是否设置 创建时间了
		 * 
		 * @param uint32_t:dwFRowCreatDate
		 *  
		 * 
		 */
		 bool  IsFRowCreatDateSet() const{
				 return  cFRowCreatDate_u != 0;
		}


		/**
		 * 获取uflag 创建时间了
		 * 
		 * @param uint32_t:dwFRowCreatDate
		 *  
		 * 
		 */
		 const uint8_t   GetFRowCreatDateUFlag() const{
				 return  cFRowCreatDate_u;
		}


		/**
		 * 设置 创建时间
		 * 
		 * @param uint32_t:dwFRowCreatDate
		 *  
		 * 
		 */
		 void  SetFRowCreatDate( const uint32_t& sVal, uint8_t cUFlag=1){
				dwFRowCreatDate = sVal;
				cFRowCreatDate_u = cUFlag;
		}


		/**
		 * 获取 创建时间
		 * 
		 * @return dwFRowCreatDate value 类型为:uint32_t
		 * 
		 */
		 const uint32_t&  GetFRowCreatDate() const {
				return dwFRowCreatDate;
		}


		/**
		 * 是否设置 修改人SysNo了
		 * 
		 * @param uint64_t:ddwFModifierSysNo
		 *  
		 * 
		 */
		 bool  IsFModifierSysNoSet() const{
				 return  cFModifierSysNo_u != 0;
		}


		/**
		 * 获取uflag 修改人SysNo了
		 * 
		 * @param uint64_t:ddwFModifierSysNo
		 *  
		 * 
		 */
		 const uint8_t   GetFModifierSysNoUFlag() const{
				 return  cFModifierSysNo_u;
		}


		/**
		 * 设置 修改人SysNo
		 * 
		 * @param uint64_t:ddwFModifierSysNo
		 *  
		 * 
		 */
		 void  SetFModifierSysNo( const uint64_t& sVal, uint8_t cUFlag=1){
				ddwFModifierSysNo = sVal;
				cFModifierSysNo_u = cUFlag;
		}


		/**
		 * 获取 修改人SysNo
		 * 
		 * @return ddwFModifierSysNo value 类型为:uint64_t
		 * 
		 */
		 const uint64_t&  GetFModifierSysNo() const {
				return ddwFModifierSysNo;
		}


		/**
		 * 是否设置 修改时间了
		 * 
		 * @param uint32_t:dwFRowModifyDate
		 *  
		 * 
		 */
		 bool  IsFRowModifyDateSet() const{
				 return  cFRowModifyDate_u != 0;
		}


		/**
		 * 获取uflag 修改时间了
		 * 
		 * @param uint32_t:dwFRowModifyDate
		 *  
		 * 
		 */
		 const uint8_t   GetFRowModifyDateUFlag() const{
				 return  cFRowModifyDate_u;
		}


		/**
		 * 设置 修改时间
		 * 
		 * @param uint32_t:dwFRowModifyDate
		 *  
		 * 
		 */
		 void  SetFRowModifyDate( const uint32_t& sVal, uint8_t cUFlag=1){
				dwFRowModifyDate = sVal;
				cFRowModifyDate_u = cUFlag;
		}


		/**
		 * 获取 修改时间
		 * 
		 * @return dwFRowModifyDate value 类型为:uint32_t
		 * 
		 */
		 const uint32_t&  GetFRowModifyDate() const {
				return dwFRowModifyDate;
		}

		virtual bool Serialize(CByteStreamNetwork& bs){
		
			uint32_t dwMyLen = 0;
			if(bs.isStoring()) //for write in buffer
			{
				//can not larger than 1 M.
				CByteStreamNetwork bsDummy(NULL, 1024 * 1024, false);
				//bsDummy for precheck the xo size...
				bsDummy.isStoring(true);
				Serialize_i(bsDummy);
				dwMyLen = bsDummy.getWrittenLength();
				bs & dwMyLen;
				Serialize_i(bs);
			}
			else
			{    //for read from buffer
				bs & dwMyLen;
				uint32_t dwReadedLen = bs.getReadLength();
				Serialize_i(bs);
				dwReadedLen = bs.getReadLength() - dwReadedLen;
				// dwReadedLen for the size of xo
				if( dwReadedLen > dwMyLen ){
					return false;
				}
				//go through the unwanted mem position...
				bs.goForward( dwMyLen - dwReadedLen );
			}

			return bs.isGood();
		}

		bool Serialize_i(CByteStreamNetwork& bsTmp){

			bsTmp & dwVersion; // 序列化 版本号    类型为uint32_t
			bsTmp & cVersion_u; // 序列化uflag 类型为uint8_t
			bsTmp & ddwFStockSysNo; // 序列化 仓库SysNo  类型为uint64_t
			bsTmp & cFStockSysNo_u; // 序列化uflag 类型为uint8_t
			bsTmp & ddwFBranchSysNo; // 序列化 分支机构SysNo  类型为uint64_t
			bsTmp & cFBranchSysNo_u; // 序列化uflag 类型为uint8_t
			bsTmp & ddwFContactSysNos; // 序列化 联系人SysNo 类型为uint64_t
			bsTmp & cFContactSysNos_u; // 序列化uflag 类型为uint8_t
			bsTmp & ddwFCreatorSysNo; // 序列化 创建人SysNo 类型为uint64_t
			bsTmp & cFCreatorSysNo_u; // 序列化uflag 类型为uint8_t
			bsTmp & dwFRowCreatDate; // 序列化 创建时间 类型为uint32_t
			bsTmp & cFRowCreatDate_u; // 序列化uflag 类型为uint8_t
			bsTmp & ddwFModifierSysNo; // 序列化 修改人SysNo 类型为uint64_t
			bsTmp & cFModifierSysNo_u; // 序列化uflag 类型为uint8_t
			bsTmp & dwFRowModifyDate; // 序列化 修改时间 类型为uint32_t
			bsTmp & cFRowModifyDate_u; // 序列化uflag 类型为uint8_t
			return bsTmp.isGood();
		}

		const char* GetLastErrMsg() const{
			return m_sLastErrMsg.c_str();
		}

		bool VerifyStockBranch_RelDdo(){

			if(!IsVersionSet()){
				m_sLastErrMsg = "Miss Param:version";
				return false;
			}

			if(!IsFStockSysNoSet()){
				m_sLastErrMsg = "Miss Param:FStockSysNo";
				return false;
			}

			if(!IsFBranchSysNoSet()){
				m_sLastErrMsg = "Miss Param:FBranchSysNo";
				return false;
			}

			if(!IsFContactSysNosSet()){
				m_sLastErrMsg = "Miss Param:FContactSysNos";
				return false;
			}

			if(!IsFCreatorSysNoSet()){
				m_sLastErrMsg = "Miss Param:FCreatorSysNo";
				return false;
			}

			if(!IsFRowCreatDateSet()){
				m_sLastErrMsg = "Miss Param:FRowCreatDate";
				return false;
			}

			if(!IsFModifierSysNoSet()){
				m_sLastErrMsg = "Miss Param:FModifierSysNo";
				return false;
			}

			if(!IsFRowModifyDateSet()){
				m_sLastErrMsg = "Miss Param:FRowModifyDate";
				return false;
			}
			return true;
		}

		void DumpData(std::ostream& oss) const{
		
			oss<<"[dwVersion:"<<dwVersion<<"] ";
			oss<<"[cVersion_u:"<<(int)cVersion_u<<"] ";
			oss<<"[ddwFStockSysNo:"<<ddwFStockSysNo<<"] ";
			oss<<"[cFStockSysNo_u:"<<(int)cFStockSysNo_u<<"] ";
			oss<<"[ddwFBranchSysNo:"<<ddwFBranchSysNo<<"] ";
			oss<<"[cFBranchSysNo_u:"<<(int)cFBranchSysNo_u<<"] ";
			oss<<"[ddwFContactSysNos:"<<ddwFContactSysNos<<"] ";
			oss<<"[cFContactSysNos_u:"<<(int)cFContactSysNos_u<<"] ";
			oss<<"[ddwFCreatorSysNo:"<<ddwFCreatorSysNo<<"] ";
			oss<<"[cFCreatorSysNo_u:"<<(int)cFCreatorSysNo_u<<"] ";
			oss<<"[dwFRowCreatDate:"<<dwFRowCreatDate<<"] ";
			oss<<"[cFRowCreatDate_u:"<<(int)cFRowCreatDate_u<<"] ";
			oss<<"[ddwFModifierSysNo:"<<ddwFModifierSysNo<<"] ";
			oss<<"[cFModifierSysNo_u:"<<(int)cFModifierSysNo_u<<"] ";
			oss<<"[dwFRowModifyDate:"<<dwFRowModifyDate<<"] ";
			oss<<"[cFRowModifyDate_u:"<<(int)cFRowModifyDate_u<<"] ";
		
		}

		// codydeng提供,非常好的dump方法 ^-^  。。。。。
		template<typename T>
		T & DumpPlusData(T& oss){
			oss<<"dwVersion:"<<dwVersion;
			oss<<"[cVersion_u:"<<cVersion_u<<"] ";
			oss<<"ddwFStockSysNo:"<<ddwFStockSysNo;
			oss<<"[cFStockSysNo_u:"<<cFStockSysNo_u<<"] ";
			oss<<"ddwFBranchSysNo:"<<ddwFBranchSysNo;
			oss<<"[cFBranchSysNo_u:"<<cFBranchSysNo_u<<"] ";
			oss<<"ddwFContactSysNos:"<<ddwFContactSysNos;
			oss<<"[cFContactSysNos_u:"<<cFContactSysNos_u<<"] ";
			oss<<"ddwFCreatorSysNo:"<<ddwFCreatorSysNo;
			oss<<"[cFCreatorSysNo_u:"<<cFCreatorSysNo_u<<"] ";
			oss<<"dwFRowCreatDate:"<<dwFRowCreatDate;
			oss<<"[cFRowCreatDate_u:"<<cFRowCreatDate_u<<"] ";
			oss<<"ddwFModifierSysNo:"<<ddwFModifierSysNo;
			oss<<"[cFModifierSysNo_u:"<<cFModifierSysNo_u<<"] ";
			oss<<"dwFRowModifyDate:"<<dwFRowModifyDate;
			oss<<"[cFRowModifyDate_u:"<<cFRowModifyDate_u<<"] ";
			return oss;
		}

		// wileywang提供,树形dump方法 ^-^  。。。。。
		void DumpDataTree(std::ostream& os, int ident = 0)const {
			g_pprint(os, "dwVersion", dwVersion, ident);
			g_pprint(os, "cVersion_u", cVersion_u, ident);
			g_pprint(os, "ddwFStockSysNo", ddwFStockSysNo, ident);
			g_pprint(os, "cFStockSysNo_u", cFStockSysNo_u, ident);
			g_pprint(os, "ddwFBranchSysNo", ddwFBranchSysNo, ident);
			g_pprint(os, "cFBranchSysNo_u", cFBranchSysNo_u, ident);
			g_pprint(os, "ddwFContactSysNos", ddwFContactSysNos, ident);
			g_pprint(os, "cFContactSysNos_u", cFContactSysNos_u, ident);
			g_pprint(os, "ddwFCreatorSysNo", ddwFCreatorSysNo, ident);
			g_pprint(os, "cFCreatorSysNo_u", cFCreatorSysNo_u, ident);
			g_pprint(os, "dwFRowCreatDate", dwFRowCreatDate, ident);
			g_pprint(os, "cFRowCreatDate_u", cFRowCreatDate_u, ident);
			g_pprint(os, "ddwFModifierSysNo", ddwFModifierSysNo, ident);
			g_pprint(os, "cFModifierSysNo_u", cFModifierSysNo_u, ident);
			g_pprint(os, "dwFRowModifyDate", dwFRowModifyDate, ident);
			g_pprint(os, "cFRowModifyDate_u", cFRowModifyDate_u, ident);
		}
		
		//提供ToString借口，默认为DumpData格式，请按需要进行修改
		std::string ToString() const{
			std::stringstream ss;
			DumpData(ss);
			return ss.str();
		}

/**
 ********************以下信息是每个版本的字段********************
 */

};

}
}
}

#endif /* ERP_STORAGE_DDO_CSTOCKBRANCH_RELDDO_BY_AUTOGEN_V5_H */
